package org.sbbs.app.license.webapp.action;

import org.sbbs.app.license.service.CustomerInfoManager;
import org.sbbs.base.search.PropertySearchBuilder;
import org.sbbs.base.webapp.action.BaseGridAction;

import com.googlecode.genericdao.search.Search;
import com.googlecode.genericdao.search.SearchResult;

public class CustomerInfoGridAction
    extends BaseGridAction {
    /**
     *
     */
    private static final long serialVersionUID = -3938015919352134327L;

    private CustomerInfoManager customerInfoManager;


    @Override
    public String gridPageList() {
            Search search = PropertySearchBuilder.BuildSearch( getRequest() );
            SearchResult srt = this.customerInfoManager.searchAndCount( search );
            this.setPageList( srt.getResult() );
            this.records = srt.getTotalCount();
            this.total = getTotlePage( records, search.getMaxResults() );
            this.page = search.getPage() + 1;
        return SUCCESS;
    }


    public CustomerInfoManager getCustomerInfoManager() {
        return customerInfoManager;
    }


    public void setCustomerInfoManager( CustomerInfoManager customerInfoManager ) {
        this.customerInfoManager = customerInfoManager;
    }


}
